# eric7.IconEditor.IconEditorWindow

Module implementing the icon editor main window.

### Global Attributes

None

### Classes

IconEditorWindow | Class implementing the web browser main window.

### Functions

None

## IconEditorWindow

Class implementing the web browser main window.

### Signals

editorClosed()
  emitted after the window was requested to close down

### Derived from

EricMainWindow

### Class Attributes

windows

### Class Methods

None

### Methods

IconEditorWindow | Constructor
__about | Private slot to show a little About message.
__aboutQt | Private slot to handle the About Qt dialog.
__checkActions | Private slot to check some actions for their enable/disable status.
__closeAll | Private slot to close all windows.
__closeOthers | Private slot to close all other windows.
__createPaletteDock | Private method to initialize the palette dock widget.
__createStatusBar | Private method to initialize the status bar.
__initActions | Private method to define the user interface actions.
__initEditActions | Private method to create the Edit actions.
__initFileActions | Private method to define the file related user interface actions.
__initFileFilters | Private method to define the supported image file filters.
__initHelpActions | Private method to create the Help actions.
__initMenus | Private method to create the menus.
__initToolbars | Private method to create the toolbars.
__initToolsActions | Private method to create the View actions.
__initViewActions | Private method to create the View actions.
__loadIconFile | Private method to load an icon file.
__maybeSave | Private method to ask the user to save the file, if it was modified.
__modificationChanged | Private slot to handle the modificationChanged signal.
__newIcon | Private slot to create a new icon.
__newWindow | Private slot called to open a new icon editor window.
__openIcon | Private slot to open an icon file.
__saveIcon | Private slot to save the icon.
__saveIconAs | Private slot to save the icon with a new name.
__saveIconFile | Private method to save to the given file.
__setCurrentFile | Private method to register the file name of the current file.
__strippedName | Private method to return the filename part of the given path.
__updatePosition | Private slot to show the current cursor position.
__updateSize | Private slot to show the current icon size.
__updateZoom | Private slot to show the current zoom factor.
__whatsThis | Private slot called in to enter Whats This mode.
__zoomIn | Private slot called to handle the zoom in action.
__zoomOut | Private slot called to handle the zoom out action.
__zoomReset | Private slot called to handle the zoom reset action.
closeEvent | Protected event handler for the close event.
event | Public method handling events.
gestureEvent | Protected method handling gesture events.
setRecentPaths | Public method to set the last open and save paths.
wheelEvent | Protected method to handle wheel events.

### Static Methods

None

#### IconEditorWindow (Constructor)

IconEditorWindow(fileName="", parent=None, fromEric=False, initShortcutsOnly=False, project=None, )

Constructor

fileName (str)
  name of a file to load on startup
parent (QWidget)
  parent widget of this window
fromEric (bool)
  flag indicating whether it was called from within eric
initShortcutsOnly (bool)
  flag indicating to just initialize the keyboard shortcuts
project (Project)
  reference to the project object

#### IconEditorWindow.__about

__about()

Private slot to show a little About message.

#### IconEditorWindow.__aboutQt

__aboutQt()

Private slot to handle the About Qt dialog.

#### IconEditorWindow.__checkActions

__checkActions()

Private slot to check some actions for their enable/disable status.

#### IconEditorWindow.__closeAll

__closeAll()

Private slot to close all windows.

#### IconEditorWindow.__closeOthers

__closeOthers()

Private slot to close all other windows.

#### IconEditorWindow.__createPaletteDock

__createPaletteDock()

Private method to initialize the palette dock widget.

#### IconEditorWindow.__createStatusBar

__createStatusBar()

Private method to initialize the status bar.

#### IconEditorWindow.__initActions

__initActions()

Private method to define the user interface actions.

#### IconEditorWindow.__initEditActions

__initEditActions()

Private method to create the Edit actions.

#### IconEditorWindow.__initFileActions

__initFileActions()

Private method to define the file related user interface actions.

#### IconEditorWindow.__initFileFilters

__initFileFilters()

Private method to define the supported image file filters.

#### IconEditorWindow.__initHelpActions

__initHelpActions()

Private method to create the Help actions.

#### IconEditorWindow.__initMenus

__initMenus()

Private method to create the menus.

#### IconEditorWindow.__initToolbars

__initToolbars()

Private method to create the toolbars.

#### IconEditorWindow.__initToolsActions

__initToolsActions()

Private method to create the View actions.

#### IconEditorWindow.__initViewActions

__initViewActions()

Private method to create the View actions.

#### IconEditorWindow.__loadIconFile

__loadIconFile(fileName)

Private method to load an icon file.

fileName (str)
  name of the icon file to load

#### IconEditorWindow.__maybeSave

__maybeSave()

Private method to ask the user to save the file, if it was modified.

Return:
  flag indicating, if it is ok to continue

Return Type:
  bool

#### IconEditorWindow.__modificationChanged

__modificationChanged(m)

Private slot to handle the modificationChanged signal.

m (bool)
  modification status

#### IconEditorWindow.__newIcon

__newIcon()

Private slot to create a new icon.

#### IconEditorWindow.__newWindow

__newWindow()

Private slot called to open a new icon editor window.

#### IconEditorWindow.__openIcon

__openIcon()

Private slot to open an icon file.

#### IconEditorWindow.__saveIcon

__saveIcon()

Private slot to save the icon.

Return:
  flag indicating success

Return Type:
  bool

#### IconEditorWindow.__saveIconAs

__saveIconAs()

Private slot to save the icon with a new name.

Return:
  flag indicating success

Return Type:
  bool

#### IconEditorWindow.__saveIconFile

__saveIconFile(fileName)

Private method to save to the given file.

fileName (str)
  name of the file to save to

Return:
  flag indicating success

Return Type:
  bool

#### IconEditorWindow.__setCurrentFile

__setCurrentFile(fileName)

Private method to register the file name of the current file.

fileName (str)
  name of the file to register

#### IconEditorWindow.__strippedName

__strippedName(fullFileName)

Private method to return the filename part of the given path.

fullFileName (str)
  full pathname of the given file

Return:
  filename part

Return Type:
  str

#### IconEditorWindow.__updatePosition

__updatePosition(x, y)

Private slot to show the current cursor position.

x (int)
  x-coordinate
y (int)
  y-coordinate

#### IconEditorWindow.__updateSize

__updateSize(w, h)

Private slot to show the current icon size.

w (int)
  width of the icon
h (int)
  height of the icon

#### IconEditorWindow.__updateZoom

__updateZoom()

Private slot to show the current zoom factor.

#### IconEditorWindow.__whatsThis

__whatsThis()

Private slot called in to enter Whats This mode.

#### IconEditorWindow.__zoomIn

__zoomIn()

Private slot called to handle the zoom in action.

#### IconEditorWindow.__zoomOut

__zoomOut()

Private slot called to handle the zoom out action.

#### IconEditorWindow.__zoomReset

__zoomReset()

Private slot called to handle the zoom reset action.

#### IconEditorWindow.closeEvent

closeEvent(evt)

Protected event handler for the close event.

evt (QCloseEvent)
  the close event
  This event is simply accepted after the history has been saved and all window references have been deleted.

#### IconEditorWindow.event

event(evt)

Public method handling events.

evt (QEvent)
  reference to the event

Return:
  flag indicating, if the event was handled

Return Type:
  bool

#### IconEditorWindow.gestureEvent

gestureEvent(evt)

Protected method handling gesture events.

evt (QGestureEvent)
  reference to the gesture event

#### IconEditorWindow.setRecentPaths

setRecentPaths(openPath, savePath)

Public method to set the last open and save paths.

openPath (str)
  least recently used open path
savePath (str)
  least recently used save path

#### IconEditorWindow.wheelEvent

wheelEvent(evt)

Protected method to handle wheel events.

evt (QWheelEvent)
  reference to the wheel event

Up